local skel = fk.CreateSkill{
  name = "sj_dianjuren__yuhuolahuan",
}

Fk:loadTranslationTable{
  ["sj_dianjuren__yuhuolahuan"] = "浴火拉环",
  [":sj_dianjuren__yuhuolahuan"] = "出牌阶段限一次，你可以与一名角色拼点：若你赢，重置〖礼花倾泻〗的次数；若你没赢，重置〖浴火拉环〗的次数。",
  ["#sj_dianjuren__yuhuolahuan"] = "浴火拉环：你可以与一名角色拼点，重置〖礼花倾泻〗或〖浴火拉环〗",
}

skel:addEffect("active", {
  prompt = "#sj_dianjuren__yuhuolahuan",
  target_filter = function (self, player, to_select, selected, selected_cards, card, extra_data)
    return player:canPindian(to_select) and #selected < 1
  end,
  card_filter = function (self, player, to_select, selected, selected_targets)
    return #selected < 1 and table.contains(player:getCardIds("h"),to_select)
  end,
  card_num = 1,
  min_card_num = 1,
  target_num = 1,
  min_target_num = 1,
  can_use = function (self, player)
    return table.find(Fk:currentRoom().alive_players,function (t)
      return player:canPindian(t)
    end) and player:usedSkillTimes(skel.name,Player.HistoryPhase) == 0
  end,
  on_use = function (self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    local card = Fk:getCardById(effect.cards[1])
    local pindian = player:pindian(effect.tos,skel.name,card)
    local name = skel.name
    if pindian.results[target].winner == player then
      name = "sj_dianjuren__lihuaqingxie"
    end
    player:setSkillUseHistory(name)
  end,
})
return skel